package com.program.cloudmanage.tripteam.persistence;

import com.program.cloudmanage.tripteam.domain.Car;
import com.program.cloudmanage.tripteam.domain.Exit;
import com.program.cloudmanage.tripteam.domain.Person;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ExitMapper {
    @Select("select * from exit")
    List<Exit> showExit();
   @Select("select * from exit where exit.exitid = #{exitid}")
   Exit showExitById(@Param("exitid") String exitid);
    @Select("select * from exit where exit.teamid = #{teamid}")
    Exit searchExitByTeamId(String teamid);

    @Insert("insert into exit(exitid,teamid,status,legal,location,expirationdate,starttime,endtime,cost) values (#{exitid},#{teamid},#{status},#{legal},#{location},#{expirationdate},#{starttime},#{endtime},#{cost})")
    void insertExit(@Param("exitid")String exitid,@Param("teamid") String teamid,@Param("status")String status,@Param("legal")String legal,@Param("location")String location,@Param("expirationdate")String expirationdate,@Param("starttime")String starttime,@Param("endtime")String endtime,@Param("cost")String cost);

    @Delete("delete from exit where exitid = #{exitid}")
    void deleteExit(String exitid);
    @Update("update exit set status=#{status},legal=#{legal},location=#{location},expirationdate=#{expirationdate},starttime=#{starttime},endtime=#{endtime},cost=#{cost} where exitid=#{exitid}")
    void updateExit(@Param("exitid")String exitid,@Param("status")String status,@Param("legal")String legal,@Param("location")String location,@Param("expirationdate")String expirationdate,@Param("starttime")String startTime,@Param("endtime")String endtime,@Param("cost")String cost);

}
